<!DOCTYPE html>
<html lang="en">
<head>
  <{include file="public_html/header_tag.html"}>
    <title>视频课详情</title>
<style>
    .video_table img{max-width: 900px;}
</style>
</head>
<body>
<script>
var iframe_index;
$(function () {
  $("#buy_now").click(function(){
    is_login = <{$logged_in}>;
    if(is_login > 0){
        $("#buy_form").submit();
    }else{
      //login/iframe
       iframe_index = layer.open({
       type: 2,
       area: ['420px', '430px'],
       fixed: false, //不固定
       maxmin: false,
       shadeClose: true,
        title: false,
       content: ['/login/iframe', 'no']
     });

    }
  });

})

function login_success(){
  parent.layer.close(iframe_index);
  window.location.href=window.location.href;
  window.location.reload;
}
</script>
<div class="wrap">
	<!--star header-->
    <div class="header">
		<{include file="public_html/header_menu.html"}>
    </div>
	<!--end  header-->

    <div class="return_nav">
    	<div class="w1200">
        您的位置：<a href="/">首页</a><span>&gt;</span><a href="/video">视频网课</a><span>&gt;</span><em>课程详情</em>
        </div>
    </div>
	<!--star main-->
    <div class="wrap_main fix">
        <!--content star-->
        <div class="col_main">
            <!--star-->
            <div class="box_item m-t10">
            	<div class="fix line-all b-FFFFFF p15">
                    <!--star-->
                    <div class="l" style="width:450px; padding-right:80px;">
                        <div>
                            <div class="img450330" id="video_info">
                                <{if !empty($video_info.image_url)}>
                                <script type="text/javascript" src="/static/www/ckplayer/ckplayer.js" charset="utf-8"></script>
                                <script type="text/javascript">
                                    var flashvars={
                                        f:'<{$video_info.video_url}>',
                                        //f:'rtmp://rtmp-live.dianmoo.com/live/123456',
                                        c:0,
                                        i:'<{$video_info.image_url}>',
                                        my_url:encodeURIComponent(window.location.href),
                                        my_title:encodeURIComponent(document.title),
                                        my_pic:'<{$video_info.image_url}>',
                                        };
                                    var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
                                    CKobject.embedSWF('/static/www/ckplayer/ckplayer.swf','video_info','ckplayer_a1','450','330',flashvars,params);
                                    /*
                                    CKobject.embedSWF(播放器路径,容器id,播放器id/name,播放器宽,播放器高,flashvars的值,其它定义也可省略);
                                    下面三行是调用html5播放器用到的
                                    */
                                    var video=['<{$video_info.video_url}>->video/mp4'];
                                    var support=['iPad','iPhone','ios','android+false','msie10+false'];
                                    CKobject.embedHTML5('video_info','ckplayer_a1',450,330,video,flashvars,support);


                                    function closelights(){//关灯
                                        alert(' 本演示不支持开关灯');
                                    }
                                    function openlights(){//开灯
                                        alert(' 本演示不支持开关灯');
                                    }
                                  </script>
                                <{else}>
                                <img src="<{$info.course_img}>">
                                <{/if}>
                            </div>
                        </div>
                    </div>
                    <!--end-->
                    <!--star-->
                    <div class="l LH40 shipdetails" style="width:390px;">
                        <div class="fs26 p-t10"><{$info.title}>

                        </div>
                        <div class="fs14 LH30 info p-t10">
                        	<ul class="wList50">
                            	<li><span class="tit">价格：</span><span class="c-FF0000">¥<em class="fs20"><{if $info.school_id == 0}><{$info.fx_price}><{else}><{$info.price}><{/if}></em></span></li>
                            	<li><span class="tit">主讲老师：</span><span><{if $info.school_id == 0}><{$info.teacher_name}><{else}><{$info.school_teacher_name}><{/if}></span></li>
                            	<!-- <li><span class="tit">满意度</span><span><{if $info.comment_count == 0}>100%<{else}><{(($info.star4+$info.star5)/$info.comment_count*100)|string_format:'%.0f'}>%<{/if}></span></li> -->
                            	<li><span class="tit">学习次数</span><span><{$info.click_num}>次</span></li>
                            	<li><span class="tit">总课时</span><span><{$info.course_time}>课时</span></li>
                            	<li><span class="tit"></span><span>
                                <{if $info.is_free ==1}>
                                <a class="fs14" style="border:1px solid #ff763f; color:#ff763f; padding:5 5 5 5px;margin:5 5 5 5px;" href="javascript:;">VIP免费</a>
                                <{/if}>
                              </span></li>
                            	<!-- <li><span class="tit">有效期</span><span><{$info.effective_time}></span></li> -->
                            </ul>
                            <div class="h30 c p-tb5"><!-- <span class="tit">机构</span><span><{$info.school_name}></span> --></div>
                            <div class="line-bottom2 p-b5 m-b5"></div>
                            <div class="ibtn LH50 p-tb15 fs20">
                                <form action="/order/buy_now" id="buy_form" method="post">
                                    <input type="hidden" name="course_id" value="<{$info.id}>" />
                                    <input type="hidden" name="num" value="1" />
                                </form>
                                <{if $is_buy == 1}>
                            	<a href="/video/play/<{$info.id}>">课程观看</a>
                                <a href="javascript:;" id="buy_now">续期</a>
                                <{else}>
                                <a href="javascript:;" id="buy_now">立即购买</a>
                                <{/if}>

                            </div>
                            <div class="">
                	            <div class="bdsharebuttonbox">
                                    <a href="#" class="bds_more" data-cmd="more"></a>
                                    <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
                                    <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
                                    <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
                                </div>
                                <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"1","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
                            </div>
                        </div>
                    </div>
                    <!--end-->
                </div>
            </div>
            <!--end-->
            <!--star-->
            <div class="box_item m-t40">
            	<div class="fix line-all b-FFFFFF shipincons">
                	<div class="mt fs16">
                    	<a class="curr" href="#A">课程介绍</a>
                    	<a href="#B">课程目录</a>
                    	<a href="#C">课程评价</a>
                    </div>
                    <div class="mc fix p25">
                    	<!--star课程介绍 -->
                    	<div class="fix">
                        	<a name="A"></a>
                            <div class="con t_form fs14">
                            	<div class="l" >
                                <table class="video_table">
                                    <colgroup>
                                        <col width="15%">
                                        <col width="75%">
                                    </colgroup>
                                    <tr>
                                        <td class="tdtit tac"><span>适用人群</span></td>
                                        <td><{$info.suitable}></td>
                                    </tr>
                                    <tr>
                                      <td class="tdtit tac"><span>教学老师</span></td>
                                      <td>
                                      <div class="LH30 p-tb20">
                                            <{if $info.school_id == 0}><{$info.teacher_name}><{else}><{$info.school_teacher_name}><{/if}>
                                        </div>
                                          <!-- <dl class="fix p-tb15">
                                              <dt class="ith_img img7070 m-r20 l"><img src="<{$info.header_img}>"></dt>
                                              <dd class="LH20 l" style="width:500px;">
                                                    <div class="fs16 p-tb10"><{$info.teacher_name}></div>
                                                    <div class="l c-666666"><{$info.intro}></div>
                                              </dd>
                                          </dl> -->
                                      </td>
                                  </tr>
                                    <tr>
                                        <td class="tdtit tac"><span>课程收益</span></td>
                                        <td>
                                        <div class="LH30 p-tb20">
                                        	<{$info.learn_what}>
                                        </div>
                                        </td>
                                    </tr>

                                </table>
                                <div class="LH30 p-tb20">
                                  <p><{$info.detail}></p>
                                </div>
                                </div>

                                <div class="r hide" style="width:300px">
                                    <dl class="fix">
                                        <dt class="ith_img img8080 m-r20 l"><img src="<{$info.school_logo}>"></dt>
                                        <dd class="LH20 p-t30"><span class="fs20"><{$info.school_name}></span></dd>
                                    </dl>
                                	<div class="fix p-t40 s_jieshao">
                                        <ul>
                                            <li><span class="tit">满意度</span><span>100%</span></li>
                                            <li><span class="tit">学生数</span><span><{$info.xuesheng_count}></span></li>
                                            <li><span class="tit">课程数</span><span><{$info.course_count}></span></li>
                                            <li><span class="tit">校长</span><span><{$info.xiaozhang}></span></li>
                                            <li><span class="tit">客服</span><span><{$info.link_phone}></span></li>
                                        </ul>
                                        <div class="ibtn LH50 p-tb15 fs16">
                                            <a class="btn-br-009edb" href="javascript:;">进入学校</a>
                                            <span class="p-lr10">&nbsp;</span>
                                            <a class="btn-br-e4e4e4" href="javascript:;">收藏学校</a>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    	<!--end课程介绍 -->
                    	<!--star课程目录 -->
                    	<div class="fix p-t20 s_kcmulu">
                        	<a name="B"></a>
                            <div class="con t_form fs14">
                            	<table width="100%">
                                    <colgroup>
                                        <col width="10%">
                                        <col width="75%">
                                        <!-- <col width="15%"> -->
                                        <col width="15%">
                                    </colgroup>

                                    <tbody>
                                    <tr>
                                        <th colspan="4" class="tdtit tal"><span class="fs16 c-333333">课程目录</span></th>
                                    </tr>
                                    </tbody>
                                    <{foreach from=$chapter key=key item=item_z}>
                                    <tbody>
                                    <tr>
                                    	<td class="tac">第<{$key}>章</td>
                                    	<td><{$item_z.name}></td>
                                    	<!-- <td class="tar"></td> -->
                                        <td class="tar"></td>
                                    </tr>
                                    <{foreach from=$item_z.jie key=k item=item_j}>
                                    <tr>
                                    	<td class="tac"><{$k+1}></td>
                                    	<td><{$item_j.name}></td>
                                    	<!-- <td class="tar"><span class="c-999999"><{$item_j.duration}></span></td> -->
                                        <td class="tar"><{if $item_j.is_free == 1 && $item_j.vid > 1}><span><a class="free_play" chapter_id="<{$item_j.id}>" href="javascript:;">免费试看</a></span><{/if}></td>
                                    </tr>
                                    <{/foreach}>
                                    </tbody>
                                    <{/foreach}>
                                </table>
                            </div>
                        </div>
                    	<!--end课程目录 -->
                    	<!--star课程评价 -->
                    	<div class="fix p-t20 s_kcmulu">
                        	<a name="C"></a>
                            <div class="con t_form fs14">
                            	<table width="100%">
                                    <colgroup>
                                        <col width="10%">
                                        <col width="75%">
                                        <col width="15%">
                                    </colgroup>
                                    <tbody>
                                    <tr>
                                        <th colspan="2" class="tdtit tal"><span class="fs16 c-333333">课程评价<span class="c-ff5215 p-l10">(<{$info.comment_count}>)</span></span></th>
                                    </tr>
                                    <tr>
                                    	<td class="tac LH50">
                                        	<div class="p30">
                                                <div class="p-lr50">
                                                    <div class="c-ff5215" style="font-size:50px;"><{if $info.comment_count == 0}>100%<{else}><{(($info.star4+$info.star5)/$info.comment_count*100)|string_format:'%.0f'}>%<{/if}></div>
                                                    <div class="fs16 c-999999">满意度</div>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                        	<div class="p30 fs14 s_pinjialist">
                                            <ul>
                                                <li class="item">
                                                    <div class="tit l"><span>1星</span><span class="c-999999 p-l10">(<{$info.star1}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star1/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>2星</span><span class="c-999999 p-l10">(<{$info.star2}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star2/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>3星</span><span class="c-999999 p-l10">(<{$info.star3}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star3/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>4星</span><span class="c-999999 p-l10">(<{$info.star4}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star4/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>5星</span><span class="c-999999 p-l10">(<{$info.star5}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star5/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                            </ul>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="fix line-all b-FFFFFF shipincons">

                            <div class="mc fix ">

                                <div class="fix  s_kcmulu">

                                    <div class="line-all fs14 s_pingNeirong">
                                      <div class="mt tabBar">
                                          <span class="tit"><input type="radio" class="show_comment" star="" checked="" name='s'><label><i class="ico_radio"></i>全部</label></span>
                                          <span class="tit"><input type="radio" class="show_comment" star="1" name='s'><label><i class="ico_radio"></i>好评</label></span>
                                          <span class="tit"><input type="radio" class="show_comment" star="2" name='s'><label><i class="ico_radio"></i>中评</label></span>
                                          <span class="tit"><input type="radio" class="show_comment" star="3" name='s'><label><i class="ico_radio"></i>差评</label></span>
                                        </div>
                                        <div class="mc fix tabCon">
                                            <!--star 全部-->
                                            <div class="divitem iframe" style="display: block;">
                                                <iframe name="myiframe" id="myiframe" onLoad="iFrameHeight('myiframe')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>"></iframe>
                                            </div>
                                            <!--end 全部-->
                                            <!--star 好评-->
                                            <div class="divitem iframe1">
                                                <iframe name="myiframe" id="myiframe1" onLoad="iFrameHeight('myiframe1')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>/1"></iframe>
                                            </div>
                                            <!--end 好评-->
                                            <!--star 中评-->
                                            <div class="divitem iframe2">
                                                <iframe name="myiframe" id="myiframe2" onLoad="iFrameHeight('myiframe2')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>/2"></iframe>
                                            </div>
                                            <!--end 中评-->
                                            <!--star 差评-->
                                            <div class="divitem iframe3">
                                                <iframe name="myiframe" id="myiframe3" onLoad="iFrameHeight('myiframe3')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>/3"></iframe>
                                            </div>
                                            <!--end 差评-->
                                        </div>
                                    </div>
                                    </div>
                                    <!--star分页-->

                                    <!--end分页-->
                                </div>
                                <!--end课程评价 -->
                            </div>

                            <!--end分页-->
                        </div>
                    	<!--end课程评价 -->
                    </div>
                </div>
            </div>
            <!--end-->
            <div class="fix" style="height:90px;"></div>
        </div>
        <!--content end-->
    </div>
	<!--end  main-->
    <!--star  footer-->
    <div class="footer b-FFFFFF">
    <{include file="public_html/footer.html"}>
    </div>
    <!--end  footer-->
</div>
</body>

<script type="text/javascript">
$("#myiframe").load(function () {
    var mainheight = $(this).contents().find("body").height() + 30;
    $(this).height(mainheight);
});
$("#myiframe1").load(function () {
    var mainheight = $(this).contents().find("body").height() + 30;
    $(this).height(mainheight);
});
$("#myiframe2").load(function () {
    var mainheight = $(this).contents().find("body").height() + 30;
    $(this).height(mainheight);
});
$("#myiframe3").load(function () {
    var mainheight = $(this).contents().find("body").height() + 30;
    $(this).height(mainheight);
});
$(".free_play").click(function(){
    var chapter_id = $(this).attr("chapter_id")
    layer.open({
        type: 2,
        title: '选择科目',
        shadeClose: true,
        shade: 0.8,
        area: ['956px', '630px'],
        maxmin: true,
        content: '/video/free_play/'+chapter_id //iframe的url
    });
})
</script>
<script>
    $(function(){
        $(".show_comment").click(function(){
            var star  = $(this).attr("star");
            $(".divitem").hide();
            $(".iframe"+star).show();
        })
    })
    function iFrameHeight(iframe_id) {   
        var ifm= document.getElementById(iframe_id);   
        var subWeb = document.frames ? document.frames[iframe_id].document : ifm.contentDocument;
        if(ifm != null && subWeb != null) {
           ifm.height = subWeb.body.scrollHeight;
           ifm.width = subWeb.body.scrollWidth;
        }   
    }
</script>
</html>
